using System;
using ICachePolicy = PHSRAG.Insight21.Policy.ICachePolicy;
using GenerateKey = PHSRAG.Insight21.BusinessObjects.ModuleKey;

namespace PHSRAG.Insight21.Humans
{
	/// <summary>
	/// Represents a collection of protocols, used to differentiate (and maintain seperation)
	/// between the instance of inactiveProtocols in the cache
	/// </summary>
	public class ActiveProtocolSummaries: ProtocolSummaries
	{
		private static string ProtocolSummariesKey = GenerateKey.MakeKey("active_protocolSummaries_574E3124-0394-4277-889C-613D4151ED2B",GenerateKey.Humans);

		/// <summary>
		/// Initilize the class with the specified cache policy.
		/// </summary>
		/// <param name="cachePolicy">specified policy to cache the instance</param>
		public ActiveProtocolSummaries(ICachePolicy cachePolicy) :	base(cachePolicy)
		{		
		}

		/// <summary>
		/// Get the key to be used in all caching operations for this instance of the object.
		/// </summary>
		public static string CacheKey	{ get { return ProtocolSummariesKey; } }

		/// <summary>
		/// Cache the current instance using the prevalent cache policy.
		/// </summary>
		public override void Cache()
		{
			CachePolicy.Cache(CacheKey, this);
		}

		/// <summary>
		/// Remove the current instance from the cache using the prevalent cache policy.
		/// </summary>
		public override void UnCache()
		{
			CachePolicy.UnCache(CacheKey);
		}

	}
}
